#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   orochi_contraband.py    
@Contact :   fengfeng.qiu@amh-group.com

@Modify Time      @Author    
------------      -------    
2022/2/18 19:05   qiufengfeng      
'''

from locust import HttpUser,task,between
import json
import pandas as pd


class HelloWorldUser(HttpUser):
    wait_time = between(0.5, 1)
    host = "https://qa-predict-phantom.amh-group.com"  # "http://localhost:8000"#"https://qa-predict-phantom.amh-group.com"
    url = "/im-question-embedding/v1/models/im-question-embedding:predict"  # "/phantom/tf-predict" #"/nlpcv-target-price-v1/v1/models/nlpcv-target-price-v1:predict"

    @task
    def hello_word(self):

        # text = "S：到车架800块钱行不行？D：不行。"* 150
        data = {"rawQuestion": "技术服务费责怎么退,技术服务费责怎么退怎么退么退"}
        header = {"Content-Type": "application/json"}
        import json
        req = self.client.post(self.url, data=json.dumps(data), headers=header)
        print( req.json())






